package com.ruoyi.project.cms.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.cms.domain.Category;
import com.ruoyi.project.cms.service.CategoryService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

@Api("栏目API文档")
@RestController
@RequestMapping("/api/category")
public class CategoryApiController extends BaseController {
	@Autowired
	private CategoryService categoryService;
	
	@ApiOperation("获取所有栏目列表数据")
	@ApiImplicitParam(name = "category", value = "栏目信息", required = true, dataType = "Article")
	@GetMapping("/list")
	public TableDataInfo list(Category category) {
		List<Category> list = categoryService.selectCategoryList(category);
		return getDataTable(list);
	}
}
